using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using MarketPlace.Data.DomainModels;
using MarketPlace.Data.Bases;

namespace MarketPlace.Data.ManagerObjects
{
    public partial interface IProductManager : IManagerBase<MarketPlace.Data.DomainModels.Product, long>
    {
		// Get Methods
		IList<Product> GetByIndustryId(System.Int64 industry);
    }

    partial class ProductManager : ManagerBase<MarketPlace.Data.DomainModels.Product, long>, IProductManager
    {
		#region Constructors
		
		public ProductManager() : base()
        {
        }
        public ProductManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Product> GetByIndustryId(System.Int64 industry)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Product));
			
			
			ICriteria industryCriteria = criteria.CreateCriteria("Industry");
            industryCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", industry));
			
			return criteria.List<Product>();
        }
		
		#endregion
    }
}